import request from '@/utils/request'

// 获取部门列表
export function getDepartments() {
  return request.get('/company/department')
}

// 获取部门负责人
export function getEmployees() {
  return request.get('sys/user/simple')
}

// 新增子部门
export const addDepartment = (data) => {
  return request.post('/company/department', data)
}

// 获取部门详情
export const getDepartmentDetail = (id) => {
  return request.get(`/company/department/${id}`)
}

// 编辑子部门
export const editDepartment = (data) => {
  return request.put(`/company/department/${data.id}`, data)
}

// 删除子部门
export const delDepartment = (id) => {
  return request.delete(`/company/department/${id}`)
}
